package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tanhua.domain.db.BlackList;
import com.tanhua.domain.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface BlackListMapper extends BaseMapper<BlackList> {

    /**
     * 自定义分页查询方法
     */
    @Select("SELECT ui.* FROM tb_user_info ui LEFT JOIN tb_black_list bl ON ui.id = bl.black_user_id WHERE bl.user_id = #{userId}")
    IPage<UserInfo> findBlackList(IPage<UserInfo> page, @Param("userId")Long userId);
}
